import React from 'react'
import { connect } from 'react-redux'
import { Button } from 'antd-mobile'
import { Redirect } from 'react-router-dom'
import { login } from '../auth.redux'

function Auth(props) {
    return (
        <div>
            { !props.isLogin ? <Button onClick={ props.login }>登录</Button> : <Redirect to='/dashborad' /> }
        </div>
    )
}


export default connect(state => state.auth, { login } )(Auth)